$.ajaxSetup({
    complete:function (xhr) {
        var h =xhr.getResponseHeader("REDIRECT");
        if("REDIRECT"==h){
            var win =window;
            while (win!=window.top){
                win =window.top;
            }
            win.location.href
                =xhr.getResponseHeader("PATH");
        }
    }
});